library(ggplot2)
library(rio)
library(dplyr)

polex <- import("estimation_file.dta")

pdf("figures/age_gamma.pdf", width=5, height=3.5)
ggplot(polex, aes(x = entryage, y = gamma)) + geom_point(alpha = .3) + geom_smooth(se = FALSE) + theme_minimal() + labs(x = "Age", y = "PolEx")

ggplot(polex %>% filter(!is.na(unieducation)), aes(x = factor(unieducation), y = gamma)) + geom_boxplot(fill = "lightgray") + theme_minimal() + labs(x = "University education", y = "PolEx")
dev.off()
